Skip to content

Game Boost validation on Intel hybrid (i9-12900K) and fixes - #134

Merged
primebuild-workflow-merge[bot] merged 17 commits into
mainfrom
perf/audit-background-startup
Nov 25, 2026
Merged

primebuild-workflow-merge[bot] merged 17 commits into
mainfrom
perf/audit-background-startup

Conversation

@PrimeBuild-pc

Copy link
Copy Markdown
Owner

What this is

Validation and fixes for Game Boost from a session on a real Intel Core i9-12900K (Alder Lake, 8P+8E), plus a background-cost audit. Full write-up: docs/validation/intel-hybrid-12900k.md, docs/validation/performance-audit-12900k.md, docs/design/protected-processes.md.

Fixes

  • Games with an anti-cheat were never detected (Arma Reforger / BattlEye): the process path was read with MainModule, which needs PROCESS_VM_READ. Now QueryFullProcessImageName with PROCESS_QUERY_LIMITED_INFORMATION.
  • Game Mode read as off when AutoGameModeEnabled (or the key) is missing; Windows 11 defaults to on. Only an explicit 0 means off.
  • Logs: Activity entries are now also written to ThreadPilot.log; Game Boost reports skipped games (unreadable path) and failed checks.
  • Processes page says who set the shown CPU Sets (Game Boost / a saved rule / other) or that Windows decides.
  • Protected processes: a refused handle on an anti-cheat game is reported as protection, not as missing admin rights. No bypass.
  • Rules: one more priority check 90 s after the process starts; labelled CPU-mask picker; the "different CPU" warning compares the brand only when both sides know it.
  • Performance: one EnumWindows pass per process-list refresh; main window opens 960 px tall.
  • Regression tests with the real i9-12900K topology (and synthetic 13th/14th gen, i5-12400, Core Ultra).

Evidence and limits

  • 1016/1016 tests pass (Release).
  • Measured on the 12900K: correct topology, game on P-cores, listed background on E-cores, correct restoration (close, toggle, mode switch, crash journal), dynamic release after 13-16 s and re-confinement after ~63 s.
  • Call of Duty (Ricochet) refuses CPU Sets from user mode (ERROR_ACCESS_DENIED); not worked around.
  • No FPS gain was measured. Not verified: CPU-bound gameplay, 13th/14th gen and Core Ultra on real hardware.

Windows 10 1703+ and Windows 11 keep Game Mode on by default and only
write HKCU\Software\Microsoft\GameBar\AutoGameModeEnabled after the user
flips the switch. The Optimizations page read a missing key or value as
'disabled', so it contradicted Windows on a clean install. Only an
explicit 0 now means off; unreadable values report the Windows default.
ServiceConfiguration registers no ILogger provider, so everything services
log through ILogger, including Game Boost session start, end, skips and
restores, never reached ThreadPilot.log; the Activity page only keeps the
current run in memory. Activity entries are now also written to the log
file as System events (one line per entry, so the volume stays what the
Activity page shows), which makes a past Game Boost session readable
after a restart.
Selecting a game during a Game Boost session showed 'Current CPU Sets:
CPU 0..15' in English with no hint of where they came from, next to a
status line that still printed the full OS affinity, so a boosted game
looked untouched. The line is now localized and names the source: Game
Boost (from its journal, via IGameSessionService.HasAppliedCpuSets), the
user's saved rule, or anything else. A process without CPU Sets says that
Windows picks its cores.
A foreground game whose executable path cannot be read (protected or
anti-cheat processes can hide it) never matches the game-library check,
so Game Boost silently did nothing. It is now reported once per process
in Activity with the manual-list workaround. A failing Game Boost tick is
also reported once per distinct error instead of only going to ILogger,
which has no provider.
The 12900K case is the CPU Set table read with GetSystemCpuSetInformation
on real hardware (24 CPU Sets, IDs 256-279, class 1 on LP 0-15, class 0 on
LP 16-23, one L3). The 13th/14th gen, i5-12400, Core Ultra and Lunar Lake
cases are synthetic and pin down what the policy decides, including that
with three efficiency classes only the top one counts as P-cores.
ProcessService took ExecutablePath from Process.MainModule, which opens
the process for PROCESS_VM_READ and walks its module list. BattlEye
refuses that right, so Arma Reforger (ArmaReforgerSteam.exe) had no path,
never matched the game-library check and Game Boost silently did nothing
for it, even though the same process accepts CPU Sets and QoS changes.

The path now comes from QueryFullProcessImageName with only
PROCESS_QUERY_LIMITED_INFORMATION, the right Task Manager uses, with
MainModule kept as the fallback. Verified on a real i9-12900K: Arma
Reforger is detected and confined to the P-cores without a manual entry.
With the CPU Sets source appended, the line for a game confined to 16
CPUs no longer fits the side panel and was cut mid-word.
Results of a validation session on a real Alder Lake CPU: what was read
from Windows for each check (topology, CPU Sets, restore, dynamic
release timings, real games), the causes found for the reported
problems, the fixes on this branch, and what is only inferred for 13th/
14th gen and Core Ultra.
Process.MainWindowHandle runs its own EnumWindows over the whole desktop
for every process, so each refresh of the process list cost processes x
windows. The list refresh now takes one snapshot with the same rule as
.NET's MainWindowFinder (first visible, unowned top-level window in Z
order) and reads titles only for processes that have a window. Measured
on 153 processes: ~2 ms of window lookups per refresh down to ~0.02 ms.
Single-process refreshes keep using Process.MainWindowHandle.
ThreadPilot always runs elevated. When OpenProcess grants the handle and
the call made with it then fails with ERROR_ACCESS_DENIED, a kernel
callback (anti-cheat, anti-tamper) stripped the rights; telling the user
the process 'may require administrator rights' sent them the wrong way.
CPU Set and efficiency/memory priority failures in that situation are now
flagged IsAntiCheatLikely with the existing 'will not try to bypass it'
message; a refused OpenProcess keeps the plain access-denied message.
Game Boost's Activity line for a refused QoS change now carries the
reason instead of 'efficiency mode not applied'.

Seen on Call of Duty (Ricochet): handles open, SetProcessDefaultCpuSets
returns 5.
Measured background cost (event-driven monitoring already below 0.1 %
of one core minimized, Game Boost tick not measurable), window-open and
hidden-after-open costs, memory of the single-file publish, startup
timeline, Assetto Corsa Competizione rule/priority behaviour, and the
design ThreadPilot follows for anti-cheat-protected games: least rights,
classify instead of retry, legitimate fallbacks (background moves, IFEO
launch priority), no SYSTEM service and no bypass techniques.
The saved priority was verified at +1 s and +3 s only. On a real run
Assetto Corsa Competizione put itself back to Normal within about a
minute of starting, after both checks had passed, so the rule silently
stopped applying. A late check at +90 s now logs the revert and uses
the same single retry as the early checks; a process that has exited by
then is skipped without an Activity entry. Still a fixed number of
checks, no polling.
WindowsCpuTopologyProvider never fills in CpuTopologySignature.CpuBrand,
so it is always 'Unknown'. A rule or mask saved with a real brand (a
hand-edited file, an import) was therefore reported on the Rules page as
pinning cores 'from a different CPU' on the very CPU it was made for.
The brand now counts only when both sides have one; core counts, group
count and the processor list still flag a real CPU change. The warning
text is localized.
Under 'Cores' the editor had an unlabeled, empty combo box that opened
the saved CPU masks, which read as a broken control. It now has a label
saying it is a CPU mask preset whose cores are applied with the mode
chosen above (CPU Sets, affinity mask or ideal processor), and shows
'Keep the current cores' until a mask is picked. The editor scrolls
instead of cutting off the Save button on short windows. Strings in all
seven languages.
At 1280 x 864 the Rules editor and other pages were cut off. The default
height is now 960; a saved size of exactly the old default (never resized
by the user) moves to the new one, and placement correction still
shrinks the window to the screen's working area on smaller displays.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T14:55:25.307332Z c8b4158 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8b415823c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Services/GameSessionService.cs Resolved
…tick

The failure message was remembered to avoid repeating it every 3 s but never cleared, so an error that came back after a recovery was never shown in Activity again.
@primebuild-workflow-merge
primebuild-workflow-merge Bot merged commit 24a50d2 into main Nov 25, 2026
3 checks passed
@primebuild-workflow-merge
primebuild-workflow-merge Bot deleted the perf/audit-background-startup branch November 25, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants